function [figLaserpos,figbeamLas,posobst,rangeLas,angleLas,xyDatNoise,nxyDat] = plotLIDARNoise(iposVeh,Obstacles,nObs)

global drang Tlidar
% Data of the LIDAR SICK (Characteristcs)

vipalab.lidar.rang = 20; %                  % Range of the Laser (m) 
vipalab.lidar.openang = 180;%170;%85;                         % Range angle of the Laser (degrees)
vipalab.lidar.ropenang = 180*pi/180;                 % Range angle of the Laser (radians)
vipalab.lidar.resol = 1;%17;%5;%0.5;                   % LIDAR resolution (degree)
vipalab.lidar.rresol = 1*pi/180;                   % LIDAR resolution (radians)

vipalab.lidar.accur = 0.04;                         % LIDAR accuracy (m)
vipalab.lidar.freq = 25;                            % LIDAR frequency (Hz)
vipalab.lidar.Tlidar = [0;1.58;0.30];               % Position of the LIDAR no VIPALAB

drang = vipalab.lidar.rang;
Tlidar = vipalab.lidar.Tlidar;
nlines = vipalab.lidar.openang/vipalab.lidar.resol;

iLaspos = iposVeh(1:2)+vipalab.lidar.Tlidar(2)*[cos(iposVeh(3));sin(iposVeh(3))];        
    
angLasmin = iposVeh(3) - vipalab.lidar.ropenang/2;
angLasmax = iposVeh(3) + vipalab.lidar.ropenang/2;
angleLas = angLasmin:vipalab.lidar.rresol:angLasmax;

for iObs=1:nObs
    [auxposobst auxrangeLas] = ComputedataLas(iLaspos,angleLas,nlines,Obstacles(2*iObs-1:2*iObs,:));
    if nObs>1
        if iObs>1
            for j=1:nlines+1
                if rangeLas(j)>auxrangeLas(j);
                    rangeLas(j) = auxrangeLas(j);
                    posobst(:,j) = auxposobst(:,j);
                end
            end        
        else
            rangeLas = auxrangeLas;
            posobst = auxposobst;
        end  
    else
        rangeLas = auxrangeLas;
        posobst = auxposobst;
    end
end

figLaserpos =0;% plot(iLaspos(1),iLaspos(2),'or');   
% figbeamLas = fill([iLaspos(1) posobst(1,:)],[iLaspos(2) posobst(2,:)],'c');        
figbeamLas = plot(posobst(1,:),posobst(2,:),'+c');

% Adding noise in the data laser
% Noise Model
Varrang = 0.05/(0.1*(2*pi)^0.5)*exp(-0.5*((rangeLas-drang)/0.1).^2);        
Noise = Varrang*drang;        

[xyDatNoise,~] = transformDataLaser(iposVeh(1:3),rangeLas,angleLas,Noise);
nxyDat = size(xyDatNoise,2);
if nxyDat>0            
    figdatptNoise = plot(xyDatNoise(1,:),xyDatNoise(2,:),'or');    
end
